package com.learn.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/01/25
 * @description
 */
@Controller
public class IndexController {
    @RequestMapping("/")
    public String index() {
        return "index";
    }
    @RequestMapping("/a")
    public String toA() {
//        return "page_a";
//        return "forward:/b";
        // 如果要跨域要写全url http://.......
        return "redirect:/b";
    }
    @RequestMapping("/b")
    public String toB() {
        return "page_b";
    }
}
